package com.sgb.kjwl.view.ui.adapter.manage;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;



import com.sgb.kjwl.BR;
import com.sgb.kjwl.view.widget.lease.common.CommonBaseAdapter;
import com.sgb.kjwl.view.widget.lease.common.CommonItemViewHolder;

import java.util.List;

/**
 * @author 张驰
 * @date 2021/4/27 11:13
 * @Description 网站标签渲染控件
 * @name com.sgb.kjwl.view.ui.adapter.manage
 */
public class TagAdapter extends CommonBaseAdapter<String, CommonItemViewHolder> {

    private int layoutResId;
    public TagAdapter(Context context, int layoutResId, List<String> datas) {
        super(context);
        this.layoutResId = layoutResId;
    }


    @Override
    protected CommonItemViewHolder onCreateViewHolderImpl(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(layoutResId, parent, false);
        return new CommonItemViewHolder(view);
    }

    @Override
    protected void onBindViewHolderImpl(CommonItemViewHolder holder, int position) {
        holder.setBinding(BR.viewModel, getItem(position));
    }

    @Override
    protected boolean isVertical() {
        return false;
    }
}
